package com.easy.auth.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.easy.auth.domain.Userinfo;
import com.easy.auth.domain.Waring;
import com.easy.auth.service.WaringService;
import com.easy.base.service.impl.EManagerImpl;
import com.easy.common.jdbc.PageInfo;
import com.easy.common.web.PagedList;

@Service
public class WaringServiceImpl extends EManagerImpl<Waring> implements
		WaringService {

	@Override
	public  PagedList<Waring> getAllWarings(Waring waring, PageInfo pageInfo){
		return super.findAllLike(waring, pageInfo);
	}

	@Override
	public int saveWaring(Waring waring) {
		return super.saveOrEdit(waring);
	}

	@Override
	public Waring findWaringById(Waring waring) {
		return super.findByOid(waring);
	}

	@Override
	public int removeWarings(String[] oids) {
		List<Waring> waringlist = new ArrayList<Waring>();
		for (String oid : oids) {
			Waring waring = new Waring();
			waring.setOid(oid);
			waringlist.add(waring);
		}
		return super.removeAll(waringlist);
	}
	@Override
	public int saveOrEditWaring(Waring waring) {
		return super.saveOrEdit(waring);
	}
}